<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ADS1118: ADS1118.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ADS1118
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">Arduino library for Texas Instruments ADS1118 chip</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ADS1118.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef ADS1118_h</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define ADS1118_h</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;Arduino.h&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;SPI.h&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="keyword">union </span><a class="code" href="union_config.html">Config</a> {</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;    <span class="keyword">struct </span>{                    </div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="union_config.html#a86063c5813b60e24dc4b53620337fb81">   16</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a86063c5813b60e24dc4b53620337fb81">reserved</a>:1;     </div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="union_config.html#aca5cedb4ac2d7fa28c9467bcc5dfdd30">   17</a></span>&#160;        uint8_t <a class="code" href="union_config.html#aca5cedb4ac2d7fa28c9467bcc5dfdd30">noOperation</a>:2;  </div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="union_config.html#a384bc94c34f34120311b0fddb47fd310">   18</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a384bc94c34f34120311b0fddb47fd310">pullUp</a>:1;       </div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="union_config.html#a4ded6b547eab12b96dd4aae64ef1e54d">   19</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a4ded6b547eab12b96dd4aae64ef1e54d">sensorMode</a>:1;   </div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="union_config.html#a36aee2d940c4f67a376a93915d97a82a">   20</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a36aee2d940c4f67a376a93915d97a82a">rate</a>:3;         </div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="union_config.html#ab095a91d71a53f3eed6961f99c1fcc8b">   21</a></span>&#160;        uint8_t <a class="code" href="union_config.html#ab095a91d71a53f3eed6961f99c1fcc8b">operatingMode</a>:1;</div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="union_config.html#a32de00c66e62581dd969c336ac1daae0">   22</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a32de00c66e62581dd969c336ac1daae0">pga</a>:3;          </div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="union_config.html#a827213c227200ea6d1495fdbd4832cbb">   23</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a827213c227200ea6d1495fdbd4832cbb">mux</a>:3;          </div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="union_config.html#a75dfa0206a4d86658d165163040905d7">   24</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a75dfa0206a4d86658d165163040905d7">singleStart</a>:1;  </div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    } <a class="code" href="union_config.html#a6a595b692a95c9ee30ba05ddd39983c2">bits</a>;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="union_config.html#a5f72e077843f5c9e51cdeb6ef2510df9">   26</a></span>&#160;    uint16_t <a class="code" href="union_config.html#a5f72e077843f5c9e51cdeb6ef2510df9">word</a>;              </div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="keyword">struct </span>{</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="union_config.html#a39309b66a0f5c8ccd880c13f0fff6b71">   28</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a39309b66a0f5c8ccd880c13f0fff6b71">lsb</a>;            </div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="union_config.html#a8ac34c174b84a90b17260847ddf749d7">   29</a></span>&#160;        uint8_t <a class="code" href="union_config.html#a8ac34c174b84a90b17260847ddf749d7">msb</a>;            </div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    } <a class="code" href="union_config.html#a35780eea5f07b69335bdfd7754eb12f1">byte</a>;                     </div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;};</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html">   38</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_a_d_s1118.html">ADS1118</a> {</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    <span class="keyword">public</span>:</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;        <a class="code" href="class_a_d_s1118.html#afaddf1d46e3b32d433c67122d96a6ebb">ADS1118</a>(uint8_t io_pin_cs);         </div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a817f1a7619d97e19475458dc3eea5f88">begin</a>();                       </div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="keywordtype">double</span> <a class="code" href="class_a_d_s1118.html#acf67a3c09b9d165f04e2e37e618e4fcb">getTemperature</a>();            </div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        uint16_t <a class="code" href="class_a_d_s1118.html#adf872650d20977b5872f88fa36182d3a">getADCValue</a>(uint8_t inputs);                   </div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <span class="keywordtype">double</span> <a class="code" href="class_a_d_s1118.html#a5d88241e78575ca86f6206f02cec0614">getMilliVolts</a>(uint8_t inputs);                   </div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <span class="keywordtype">double</span> <a class="code" href="class_a_d_s1118.html#a5d88241e78575ca86f6206f02cec0614">getMilliVolts</a>();             </div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a8d79b157a07574bd8745137a8347649e">decodeConfigRegister</a>(<span class="keyword">union</span> <a class="code" href="union_config.html">Config</a> <a class="code" href="class_a_d_s1118.html#ab41e0ba159527f2fc8d48cbedc653380">configRegister</a>); </div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#abcabaf741cc3e45e53a6967e0d113073">setSampligRate</a>(uint8_t samplingRate);              </div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a15fcd99b88c988fef9b4cc04347b08a5">setFullScaleRange</a>(uint8_t fsr);</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#af739fb00547d7a5df8c5010c40b64c6a">setContinuousMode</a>();           </div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a9e2e456dee0ee957fe89319d12bd833c">setSingleShotMode</a>();           </div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a649c53bdf46a93b5ab682d04b9f9df5e">disablePullup</a>();               </div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a833326b882b86608d62450fcedabbe4a">enablePullup</a>();                </div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordtype">void</span> <a class="code" href="class_a_d_s1118.html#a074c71a9eeb1d0db946f5f4b1308c69f">setInputSelected</a>(uint8_t input);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="comment">//Input multiplexer configuration selection for bits &quot;MUX&quot;</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;            <span class="comment">//Differential inputs</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#ad655c0ffe0e3fb2c8c2644176c67f1aa">   56</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#ad655c0ffe0e3fb2c8c2644176c67f1aa">DIFF_0_1</a>    = 0b000;  </div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a1caeae913293ef4806516976a2dc7f4b">   57</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a1caeae913293ef4806516976a2dc7f4b">DIFF_0_3</a>    = 0b001;  </div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a683b66748ece91703c8ccc1920a6f762">   58</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a683b66748ece91703c8ccc1920a6f762">DIFF_1_3</a>    = 0b010;  </div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a8e9e4f86cb2487a24b539c2f7424324d">   59</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a8e9e4f86cb2487a24b539c2f7424324d">DIFF_2_3</a>    = 0b011;  </div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <span class="comment">//Single ended inputs</span></div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#aca6400b67c3254276ac2bee98153ce1b">   61</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#aca6400b67c3254276ac2bee98153ce1b">AIN_0</a>       = 0b100;  </div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a252939e56baf2c563a81778d36471b57">   62</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a252939e56baf2c563a81778d36471b57">AIN_1</a>       = 0b101;  </div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#ae54c53aaa6546ca3d6ff0a5f94bca2da">   63</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#ae54c53aaa6546ca3d6ff0a5f94bca2da">AIN_2</a>       = 0b110;  </div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a960aed37cacaba71cdc4d4761bce7fd4">   64</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a960aed37cacaba71cdc4d4761bce7fd4">AIN_3</a>       = 0b111;  </div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#ab41e0ba159527f2fc8d48cbedc653380">   65</a></span>&#160;        <span class="keyword">union </span><a class="code" href="union_config.html">Config</a> <a class="code" href="class_a_d_s1118.html#ab41e0ba159527f2fc8d48cbedc653380">configRegister</a>;        </div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="comment">//Bit constants</span></div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a2e1f9b252a8468439c3c4a8b46ec5b9e">   68</a></span>&#160;        <span class="keyword">const</span> uint16_t <a class="code" href="class_a_d_s1118.html#a2e1f9b252a8468439c3c4a8b46ec5b9e">SCLK</a>       = 2000000;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        </div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <span class="comment">// Used by &quot;SS&quot; bit</span></div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#af146984531345834e8caaf0ffe017735">   71</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#af146984531345834e8caaf0ffe017735">START_NOW</a>   = 1;      </div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        </div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="comment">// Used by &quot;TS_MODE&quot; bit</span></div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#ace81e16e9c09d65487c451dbc0c86cc5">   74</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#ace81e16e9c09d65487c451dbc0c86cc5">ADC_MODE</a>    = 0;      </div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#aae519c1c967c59c8d40e06f7517fca0c">   75</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#aae519c1c967c59c8d40e06f7517fca0c">TEMP_MODE</a>   = 1;      </div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        </div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        <span class="comment">// Used by &quot;MODE&quot; bit</span></div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#ac79cd7f4808c3b4ff2721e2e8b6140ba">   78</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#ac79cd7f4808c3b4ff2721e2e8b6140ba">CONTINUOUS</a>  = 0;      </div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a71a3c608158cd617c24b51986f2fccc0">   79</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a71a3c608158cd617c24b51986f2fccc0">SINGLE_SHOT</a> = 1;      </div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        </div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;        <span class="comment">// Used by &quot;PULL_UP_EN&quot; bit</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#ab5035f17d58adff567e8002d3e5c40fa">   82</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#ab5035f17d58adff567e8002d3e5c40fa">PULLUP</a>      = 1;      </div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a9c4404b5040ec1b5f43094961e2f62d5">   83</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a9c4404b5040ec1b5f43094961e2f62d5">NO_PULLUP</a>   = 0;      </div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        </div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;        <span class="comment">// Used by &quot;NOP&quot; bits</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#afc7ff1f66a8cda9826daeaf3fe5ba6ab">   86</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#afc7ff1f66a8cda9826daeaf3fe5ba6ab">VALID_CFG</a>   = 0b01;   </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#aca0198f642c007b7ae32728ecc7b4b1f">   87</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#aca0198f642c007b7ae32728ecc7b4b1f">NO_VALID_CFG</a>= 0b00;   </div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        </div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <span class="comment">// Used by &quot;Reserved&quot; bit</span></div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#addf0469ded07f0cf2c7566745a9bf197">   90</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#addf0469ded07f0cf2c7566745a9bf197">RESERVED</a>    = 1;      </div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="comment">/*Full scale range (FSR) selection by &quot;PGA&quot; bits. </span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="comment">         [Warning: this could increase the noise and the effective number of bits (ENOB). See tables above]*/</span></div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#afc58ecaefacef5592c90c4c843d81dde">   94</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#afc58ecaefacef5592c90c4c843d81dde">FSR_6144</a>    = 0b000;  </div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a9ef5d9e47353e4e30ceab533e2edf3ad">   95</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a9ef5d9e47353e4e30ceab533e2edf3ad">FSR_4096</a>    = 0b001;  </div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a2acfebaaa24ac5a6925be110a5a3edfa">   96</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a2acfebaaa24ac5a6925be110a5a3edfa">FSR_2048</a>    = 0b010;  </div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a64ab7dc3b0b643889a45b4a8a15ed73b">   97</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a64ab7dc3b0b643889a45b4a8a15ed73b">FSR_1024</a>    = 0b011;  </div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#aa90c0882b487e68fa6cfe27790d6a5fa">   98</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#aa90c0882b487e68fa6cfe27790d6a5fa">FSR_0512</a>    = 0b100;  </div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a5b0abd4476219e551141a10c1266c451">   99</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a5b0abd4476219e551141a10c1266c451">FSR_0256</a>    = 0b111;  </div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <span class="comment">/*Sampling rate selection by &quot;DR&quot; bits. </span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="comment">        [Warning: this could increase the noise and the effective number of bits (ENOB). See tables above]*/</span></div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a693fdcb47c270a6f3244df1eefdca4ca">  103</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a693fdcb47c270a6f3244df1eefdca4ca">RATE_8SPS</a>   = 0b000;  </div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a6b92ca329799360f0dfc19bec589280c">  104</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a6b92ca329799360f0dfc19bec589280c">RATE_16SPS</a>  = 0b001;  </div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#af9f2d072f99bdce404c613135ba07829">  105</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#af9f2d072f99bdce404c613135ba07829">RATE_32SPS</a>  = 0b010;  </div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a6f1e5499c69409830f3dad1c0c66fc07">  106</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a6f1e5499c69409830f3dad1c0c66fc07">RATE_64SPS</a>  = 0b011;  </div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a10ab539a0704cc42d3441f3c94a9a649">  107</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a10ab539a0704cc42d3441f3c94a9a649">RATE_128SPS</a> = 0b100;  </div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a6deae5bd5b8578a481b376349edcebe1">  108</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a6deae5bd5b8578a481b376349edcebe1">RATE_250SPS</a> = 0b101;  </div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#a5682051293d721f5efc05d05f997d150">  109</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#a5682051293d721f5efc05d05f997d150">RATE_475SPS</a> = 0b110;  </div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="class_a_d_s1118.html#adaff9f6a747f4b3b6cb10608b8581ab0">  110</a></span>&#160;        <span class="keyword">const</span> uint8_t <a class="code" href="class_a_d_s1118.html#adaff9f6a747f4b3b6cb10608b8581ab0">RATE_860SPS</a> = 0b111;  </div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        </div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        uint8_t lastSensorMode=3;           </div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        uint8_t cs;                         </div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">float</span> pgaFSR[8] = {6.144, 4.096, 2.048, 1.024, 0.512, 0.256, 0.256, 0.256};</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="keyword">const</span> uint8_t CONV_TIME[8]={125, 63, 32, 16, 8, 4, 3, 2};   </div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="comment">                            Table 1. Noise in μVRMS (μVPP) at VDD = 3.3 V   [1]</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="comment">                                DATA RATE FSR (Full-Scale Range)</span></div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="comment">  (SPS) ±6.144 V        ±4.096 V     ±2.048 V       ±1.024 V        ±0.512 V        ±0.256 V</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="comment">    8   187.5 (187.5)   125 (125)    62.5 (62.5)    31.25 (31.25)   15.62 (15.62)   7.81 (7.81)</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="comment">    16  187.5 (187.5)   125 (125)    62.5 (62.5)    31.25 (31.25)   15.62 (15.62)   7.81 (7.81)</span></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="comment">    32  187.5 (187.5)   125 (125)    62.5 (62.5)    31.25 (31.25)   15.62 (15.62)   7.81 (7.81)</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="comment">    64  187.5 (187.5)   125 (125)    62.5 (62.5)    31.25 (31.25)   15.62 (15.62)   7.81 (7.81)</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="comment">    128 187.5 (187.5)   125 (125)    62.5 (62.5)    31.25 (31.25)   15.62 (15.62)   7.81 (12.35)</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;<span class="comment">    250 187.5 (252.09)  125 (148.28) 62.5 (84.03)   31.25 (39.54)   15.62 (16.06)   7.81 (18.53)</span></div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="comment">    475 187.5 (266.92)  125 (227.38) 62.5 (79.08)   31.25 (56.84)   15.62 (32.13)   7.81 (25.95)</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="comment">    860 187.5 (430.06)  125 (266.93) 62.5 (118.63)  31.25 (64.26)   15.62 (40.78)   7.81 (35.83)</span></div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;<span class="comment">    </span></div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="comment">            Table 2. ENOB from RMS Noise (Noise-Free Bits from Peak-to-Peak Noise) at VDD = 3.3 V</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="comment">                                DATA RATE FSR (Full-Scale Range)</span></div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;<span class="comment">  (SPS)     ±6.144 V    ±4.096 V     ±2.048 V       ±1.024 V        ±0.512 V        ±0.256 V</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;<span class="comment">    8       16 (16)     16 (16)      16 (16)        16 (16)         16 (16)         16 (16)</span></div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;<span class="comment">    16      16 (16)     16 (16)      16 (16)        16 (16)         16 (16)         16 (16)</span></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="comment">    32      16 (16)     16 (16)      16 (16)        16 (16)         16 (16)         16 (16)</span></div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="comment">    64      16 (16)     16 (16)      16 (16)        16 (16)         16 (16)         16 (16)</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="comment">    128     16 (16)     16 (16)      16 (16)        16 (16)         16 (16)         16 (15.33)</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment">    250     16 (15.57)  16 (15.75)   16 (15.57)     16 (15.66)      16 (15.96)      16 (14.75)</span></div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="comment">    475     16 (15.49)  16 (15.13)   16 (15.66)     16 (15.13)      16 (14.95)      16 (14.26)</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="comment">    860     16 (14.8)   16 (14.9)    16 (15.07)     16 (14.95)      16 (14.61)      16 (13.8)</span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="comment">    </span></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="comment">    </span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="comment">    [1] Texas Instruments, &quot;ADS1118 Ultrasmall, Low-Power, SPI™-Compatible, 16-Bit Analog-to-Digital </span></div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="comment">    Converter with Internal Reference and Temperature Sensor&quot;, ADS1118 datasheet, SBAS457E [OCTOBER 2010–REVISED OCTOBER 2015]. </span></div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="comment">    </span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="comment">    Note: This information is taken from http://www.ti.com</span></div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="comment">          Copyright © 2010–2015, Texas Instruments Incorporated</span></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="comment">*/</span>      </div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;};</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="class_a_d_s1118_html_a960aed37cacaba71cdc4d4761bce7fd4"><div class="ttname"><a href="class_a_d_s1118.html#a960aed37cacaba71cdc4d4761bce7fd4">ADS1118::AIN_3</a></div><div class="ttdeci">const uint8_t AIN_3</div><div class="ttdoc">Single ended input: Vin=A3. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:64</div></div>
<div class="ttc" id="class_a_d_s1118_html_afc58ecaefacef5592c90c4c843d81dde"><div class="ttname"><a href="class_a_d_s1118.html#afc58ecaefacef5592c90c4c843d81dde">ADS1118::FSR_6144</a></div><div class="ttdeci">const uint8_t FSR_6144</div><div class="ttdoc">Range: ±6.144 v. LSB SIZE = 187.5μV. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:94</div></div>
<div class="ttc" id="class_a_d_s1118_html_afc7ff1f66a8cda9826daeaf3fe5ba6ab"><div class="ttname"><a href="class_a_d_s1118.html#afc7ff1f66a8cda9826daeaf3fe5ba6ab">ADS1118::VALID_CFG</a></div><div class="ttdeci">const uint8_t VALID_CFG</div><div class="ttdoc">Data will be written to Config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:86</div></div>
<div class="ttc" id="class_a_d_s1118_html_aae519c1c967c59c8d40e06f7517fca0c"><div class="ttname"><a href="class_a_d_s1118.html#aae519c1c967c59c8d40e06f7517fca0c">ADS1118::TEMP_MODE</a></div><div class="ttdeci">const uint8_t TEMP_MODE</div><div class="ttdoc">Internal temperature sensor reading mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:75</div></div>
<div class="ttc" id="union_config_html_a827213c227200ea6d1495fdbd4832cbb"><div class="ttname"><a href="union_config.html#a827213c227200ea6d1495fdbd4832cbb">Config::mux</a></div><div class="ttdeci">uint8_t mux</div><div class="ttdoc">&quot;MUX&quot; bits </div><div class="ttdef"><b>Definition:</b> ADS1118.h:23</div></div>
<div class="ttc" id="class_a_d_s1118_html_a6b92ca329799360f0dfc19bec589280c"><div class="ttname"><a href="class_a_d_s1118.html#a6b92ca329799360f0dfc19bec589280c">ADS1118::RATE_16SPS</a></div><div class="ttdeci">const uint8_t RATE_16SPS</div><div class="ttdoc">16 samples/s, Tconv=62.5ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:104</div></div>
<div class="ttc" id="union_config_html_a32de00c66e62581dd969c336ac1daae0"><div class="ttname"><a href="union_config.html#a32de00c66e62581dd969c336ac1daae0">Config::pga</a></div><div class="ttdeci">uint8_t pga</div><div class="ttdoc">&quot;PGA&quot; bits </div><div class="ttdef"><b>Definition:</b> ADS1118.h:22</div></div>
<div class="ttc" id="class_a_d_s1118_html_aa90c0882b487e68fa6cfe27790d6a5fa"><div class="ttname"><a href="class_a_d_s1118.html#aa90c0882b487e68fa6cfe27790d6a5fa">ADS1118::FSR_0512</a></div><div class="ttdeci">const uint8_t FSR_0512</div><div class="ttdoc">Range: ±0.512 v. LSB SIZE = 15.625μV. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:98</div></div>
<div class="ttc" id="class_a_d_s1118_html_ad655c0ffe0e3fb2c8c2644176c67f1aa"><div class="ttname"><a href="class_a_d_s1118.html#ad655c0ffe0e3fb2c8c2644176c67f1aa">ADS1118::DIFF_0_1</a></div><div class="ttdeci">const uint8_t DIFF_0_1</div><div class="ttdoc">Differential input: Vin=A0-A1. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:56</div></div>
<div class="ttc" id="class_a_d_s1118_html_a5682051293d721f5efc05d05f997d150"><div class="ttname"><a href="class_a_d_s1118.html#a5682051293d721f5efc05d05f997d150">ADS1118::RATE_475SPS</a></div><div class="ttdeci">const uint8_t RATE_475SPS</div><div class="ttdoc">475 samples/s, Tconv=2.105ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:109</div></div>
<div class="ttc" id="class_a_d_s1118_html_aca6400b67c3254276ac2bee98153ce1b"><div class="ttname"><a href="class_a_d_s1118.html#aca6400b67c3254276ac2bee98153ce1b">ADS1118::AIN_0</a></div><div class="ttdeci">const uint8_t AIN_0</div><div class="ttdoc">Single ended input: Vin=A0. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:61</div></div>
<div class="ttc" id="class_a_d_s1118_html_a10ab539a0704cc42d3441f3c94a9a649"><div class="ttname"><a href="class_a_d_s1118.html#a10ab539a0704cc42d3441f3c94a9a649">ADS1118::RATE_128SPS</a></div><div class="ttdeci">const uint8_t RATE_128SPS</div><div class="ttdoc">128 samples/s, Tconv=7.8125ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:107</div></div>
<div class="ttc" id="union_config_html_a4ded6b547eab12b96dd4aae64ef1e54d"><div class="ttname"><a href="union_config.html#a4ded6b547eab12b96dd4aae64ef1e54d">Config::sensorMode</a></div><div class="ttdeci">uint8_t sensorMode</div><div class="ttdoc">&quot;TS_MODE&quot; bit </div><div class="ttdef"><b>Definition:</b> ADS1118.h:19</div></div>
<div class="ttc" id="class_a_d_s1118_html_aca0198f642c007b7ae32728ecc7b4b1f"><div class="ttname"><a href="class_a_d_s1118.html#aca0198f642c007b7ae32728ecc7b4b1f">ADS1118::NO_VALID_CFG</a></div><div class="ttdeci">const uint8_t NO_VALID_CFG</div><div class="ttdoc">Data won&amp;#39;t be written to Config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:87</div></div>
<div class="ttc" id="union_config_html_a39309b66a0f5c8ccd880c13f0fff6b71"><div class="ttname"><a href="union_config.html#a39309b66a0f5c8ccd880c13f0fff6b71">Config::lsb</a></div><div class="ttdeci">uint8_t lsb</div><div class="ttdoc">Byte LSB. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:28</div></div>
<div class="ttc" id="class_a_d_s1118_html_a649c53bdf46a93b5ab682d04b9f9df5e"><div class="ttname"><a href="class_a_d_s1118.html#a649c53bdf46a93b5ab682d04b9f9df5e">ADS1118::disablePullup</a></div><div class="ttdeci">void disablePullup()</div><div class="ttdoc">Disabling the internal pull-up resistor of the DOUT pin. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:226</div></div>
<div class="ttc" id="class_a_d_s1118_html_a252939e56baf2c563a81778d36471b57"><div class="ttname"><a href="class_a_d_s1118.html#a252939e56baf2c563a81778d36471b57">ADS1118::AIN_1</a></div><div class="ttdeci">const uint8_t AIN_1</div><div class="ttdoc">Single ended input: Vin=A1. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:62</div></div>
<div class="ttc" id="union_config_html_a36aee2d940c4f67a376a93915d97a82a"><div class="ttname"><a href="union_config.html#a36aee2d940c4f67a376a93915d97a82a">Config::rate</a></div><div class="ttdeci">uint8_t rate</div><div class="ttdoc">&quot;DR&quot; bits </div><div class="ttdef"><b>Definition:</b> ADS1118.h:20</div></div>
<div class="ttc" id="class_a_d_s1118_html_a817f1a7619d97e19475458dc3eea5f88"><div class="ttname"><a href="class_a_d_s1118.html#a817f1a7619d97e19475458dc3eea5f88">ADS1118::begin</a></div><div class="ttdeci">void begin()</div><div class="ttdoc">This method initialize the SPI port and the config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:77</div></div>
<div class="ttc" id="class_a_d_s1118_html_a1caeae913293ef4806516976a2dc7f4b"><div class="ttname"><a href="class_a_d_s1118.html#a1caeae913293ef4806516976a2dc7f4b">ADS1118::DIFF_0_3</a></div><div class="ttdeci">const uint8_t DIFF_0_3</div><div class="ttdoc">Differential input: Vin=A0-A3. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:57</div></div>
<div class="ttc" id="class_a_d_s1118_html_a15fcd99b88c988fef9b4cc04347b08a5"><div class="ttname"><a href="class_a_d_s1118.html#a15fcd99b88c988fef9b4cc04347b08a5">ADS1118::setFullScaleRange</a></div><div class="ttdeci">void setFullScaleRange(uint8_t fsr)</div><div class="ttdoc">Setting the full scale range in the config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:197</div></div>
<div class="ttc" id="class_a_d_s1118_html_adaff9f6a747f4b3b6cb10608b8581ab0"><div class="ttname"><a href="class_a_d_s1118.html#adaff9f6a747f4b3b6cb10608b8581ab0">ADS1118::RATE_860SPS</a></div><div class="ttdeci">const uint8_t RATE_860SPS</div><div class="ttdoc">860 samples/s, Tconv=1.163ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:110</div></div>
<div class="ttc" id="class_a_d_s1118_html_a9ef5d9e47353e4e30ceab533e2edf3ad"><div class="ttname"><a href="class_a_d_s1118.html#a9ef5d9e47353e4e30ceab533e2edf3ad">ADS1118::FSR_4096</a></div><div class="ttdeci">const uint8_t FSR_4096</div><div class="ttdoc">Range: ±4.096 v. LSB SIZE = 125μV. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:95</div></div>
<div class="ttc" id="class_a_d_s1118_html_a693fdcb47c270a6f3244df1eefdca4ca"><div class="ttname"><a href="class_a_d_s1118.html#a693fdcb47c270a6f3244df1eefdca4ca">ADS1118::RATE_8SPS</a></div><div class="ttdeci">const uint8_t RATE_8SPS</div><div class="ttdoc">8 samples/s, Tconv=125ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:103</div></div>
<div class="ttc" id="union_config_html_a5f72e077843f5c9e51cdeb6ef2510df9"><div class="ttname"><a href="union_config.html#a5f72e077843f5c9e51cdeb6ef2510df9">Config::word</a></div><div class="ttdeci">uint16_t word</div><div class="ttdoc">Representation in word (16-bits) format. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:26</div></div>
<div class="ttc" id="class_a_d_s1118_html_a9c4404b5040ec1b5f43094961e2f62d5"><div class="ttname"><a href="class_a_d_s1118.html#a9c4404b5040ec1b5f43094961e2f62d5">ADS1118::NO_PULLUP</a></div><div class="ttdeci">const uint8_t NO_PULLUP</div><div class="ttdoc">Internal pull-up resistor disabled. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:83</div></div>
<div class="ttc" id="class_a_d_s1118_html_ace81e16e9c09d65487c451dbc0c86cc5"><div class="ttname"><a href="class_a_d_s1118.html#ace81e16e9c09d65487c451dbc0c86cc5">ADS1118::ADC_MODE</a></div><div class="ttdeci">const uint8_t ADC_MODE</div><div class="ttdoc">External (inputs) voltage reading mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:74</div></div>
<div class="ttc" id="union_config_html_aca5cedb4ac2d7fa28c9467bcc5dfdd30"><div class="ttname"><a href="union_config.html#aca5cedb4ac2d7fa28c9467bcc5dfdd30">Config::noOperation</a></div><div class="ttdeci">uint8_t noOperation</div><div class="ttdoc">&quot;NOP&quot; bits </div><div class="ttdef"><b>Definition:</b> ADS1118.h:17</div></div>
<div class="ttc" id="union_config_html_a6a595b692a95c9ee30ba05ddd39983c2"><div class="ttname"><a href="union_config.html#a6a595b692a95c9ee30ba05ddd39983c2">Config::bits</a></div><div class="ttdeci">struct Config::@0 bits</div><div class="ttdoc">Structure of the config register of the ADS1118. (See datasheet [1]) </div></div>
<div class="ttc" id="class_a_d_s1118_html_a5b0abd4476219e551141a10c1266c451"><div class="ttname"><a href="class_a_d_s1118.html#a5b0abd4476219e551141a10c1266c451">ADS1118::FSR_0256</a></div><div class="ttdeci">const uint8_t FSR_0256</div><div class="ttdoc">Range: ±0.256 v. LSB SIZE = 7.8125μV. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:99</div></div>
<div class="ttc" id="class_a_d_s1118_html_a2acfebaaa24ac5a6925be110a5a3edfa"><div class="ttname"><a href="class_a_d_s1118.html#a2acfebaaa24ac5a6925be110a5a3edfa">ADS1118::FSR_2048</a></div><div class="ttdeci">const uint8_t FSR_2048</div><div class="ttdoc">Range: ±2.048 v. LSB SIZE = 62.5μV ***DEFAULT. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:96</div></div>
<div class="ttc" id="class_a_d_s1118_html_abcabaf741cc3e45e53a6967e0d113073"><div class="ttname"><a href="class_a_d_s1118.html#abcabaf741cc3e45e53a6967e0d113073">ADS1118::setSampligRate</a></div><div class="ttdeci">void setSampligRate(uint8_t samplingRate)</div><div class="ttdoc">Setting the sampling rate specified in the config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:189</div></div>
<div class="ttc" id="class_a_d_s1118_html"><div class="ttname"><a href="class_a_d_s1118.html">ADS1118</a></div><div class="ttdef"><b>Definition:</b> ADS1118.h:38</div></div>
<div class="ttc" id="union_config_html_a86063c5813b60e24dc4b53620337fb81"><div class="ttname"><a href="union_config.html#a86063c5813b60e24dc4b53620337fb81">Config::reserved</a></div><div class="ttdeci">uint8_t reserved</div><div class="ttdoc">&quot;Reserved&quot; bit </div><div class="ttdef"><b>Definition:</b> ADS1118.h:16</div></div>
<div class="ttc" id="class_a_d_s1118_html_a5d88241e78575ca86f6206f02cec0614"><div class="ttname"><a href="class_a_d_s1118.html#a5d88241e78575ca86f6206f02cec0614">ADS1118::getMilliVolts</a></div><div class="ttdeci">double getMilliVolts()</div><div class="ttdoc">Getting the millivolts from the settled inputs. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:140</div></div>
<div class="ttc" id="union_config_html"><div class="ttname"><a href="union_config.html">Config</a></div><div class="ttdoc">Union configuration register. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:13</div></div>
<div class="ttc" id="class_a_d_s1118_html_a074c71a9eeb1d0db946f5f4b1308c69f"><div class="ttname"><a href="class_a_d_s1118.html#a074c71a9eeb1d0db946f5f4b1308c69f">ADS1118::setInputSelected</a></div><div class="ttdeci">void setInputSelected(uint8_t input)</div><div class="ttdoc">Setting the inputs to be adquired in the config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:205</div></div>
<div class="ttc" id="class_a_d_s1118_html_a833326b882b86608d62450fcedabbe4a"><div class="ttname"><a href="class_a_d_s1118.html#a833326b882b86608d62450fcedabbe4a">ADS1118::enablePullup</a></div><div class="ttdeci">void enablePullup()</div><div class="ttdoc">Enabling the internal pull-up resistor of the DOUT pin. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:233</div></div>
<div class="ttc" id="class_a_d_s1118_html_a6deae5bd5b8578a481b376349edcebe1"><div class="ttname"><a href="class_a_d_s1118.html#a6deae5bd5b8578a481b376349edcebe1">ADS1118::RATE_250SPS</a></div><div class="ttdeci">const uint8_t RATE_250SPS</div><div class="ttdoc">250 samples/s, Tconv=4ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:108</div></div>
<div class="ttc" id="class_a_d_s1118_html_ae54c53aaa6546ca3d6ff0a5f94bca2da"><div class="ttname"><a href="class_a_d_s1118.html#ae54c53aaa6546ca3d6ff0a5f94bca2da">ADS1118::AIN_2</a></div><div class="ttdeci">const uint8_t AIN_2</div><div class="ttdoc">Single ended input: Vin=A2. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:63</div></div>
<div class="ttc" id="class_a_d_s1118_html_a64ab7dc3b0b643889a45b4a8a15ed73b"><div class="ttname"><a href="class_a_d_s1118.html#a64ab7dc3b0b643889a45b4a8a15ed73b">ADS1118::FSR_1024</a></div><div class="ttdeci">const uint8_t FSR_1024</div><div class="ttdoc">Range: ±1.024 v. LSB SIZE = 31.25μV. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:97</div></div>
<div class="ttc" id="union_config_html_ab095a91d71a53f3eed6961f99c1fcc8b"><div class="ttname"><a href="union_config.html#ab095a91d71a53f3eed6961f99c1fcc8b">Config::operatingMode</a></div><div class="ttdeci">uint8_t operatingMode</div><div class="ttdoc">&quot;MODE&quot; bit </div><div class="ttdef"><b>Definition:</b> ADS1118.h:21</div></div>
<div class="ttc" id="class_a_d_s1118_html_a9e2e456dee0ee957fe89319d12bd833c"><div class="ttname"><a href="class_a_d_s1118.html#a9e2e456dee0ee957fe89319d12bd833c">ADS1118::setSingleShotMode</a></div><div class="ttdeci">void setSingleShotMode()</div><div class="ttdoc">Setting to single shot adquisition and power down mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:219</div></div>
<div class="ttc" id="class_a_d_s1118_html_a6f1e5499c69409830f3dad1c0c66fc07"><div class="ttname"><a href="class_a_d_s1118.html#a6f1e5499c69409830f3dad1c0c66fc07">ADS1118::RATE_64SPS</a></div><div class="ttdeci">const uint8_t RATE_64SPS</div><div class="ttdoc">64 samples/s, Tconv=15.625ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:106</div></div>
<div class="ttc" id="class_a_d_s1118_html_ab5035f17d58adff567e8002d3e5c40fa"><div class="ttname"><a href="class_a_d_s1118.html#ab5035f17d58adff567e8002d3e5c40fa">ADS1118::PULLUP</a></div><div class="ttdeci">const uint8_t PULLUP</div><div class="ttdoc">Internal pull-up resistor enabled for DOUT ***DEFAULT. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:82</div></div>
<div class="ttc" id="class_a_d_s1118_html_a71a3c608158cd617c24b51986f2fccc0"><div class="ttname"><a href="class_a_d_s1118.html#a71a3c608158cd617c24b51986f2fccc0">ADS1118::SINGLE_SHOT</a></div><div class="ttdeci">const uint8_t SINGLE_SHOT</div><div class="ttdoc">Single-shot conversion and power down mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:79</div></div>
<div class="ttc" id="union_config_html_a35780eea5f07b69335bdfd7754eb12f1"><div class="ttname"><a href="union_config.html#a35780eea5f07b69335bdfd7754eb12f1">Config::byte</a></div><div class="ttdeci">struct Config::@1 byte</div><div class="ttdoc">Representation in bytes (8-bits) format. </div></div>
<div class="ttc" id="class_a_d_s1118_html_a2e1f9b252a8468439c3c4a8b46ec5b9e"><div class="ttname"><a href="class_a_d_s1118.html#a2e1f9b252a8468439c3c4a8b46ec5b9e">ADS1118::SCLK</a></div><div class="ttdeci">const uint16_t SCLK</div><div class="ttdoc">ADS1118 SCLK frequency: 4000000 Hz Maximum for ADS1118. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:68</div></div>
<div class="ttc" id="union_config_html_a8ac34c174b84a90b17260847ddf749d7"><div class="ttname"><a href="union_config.html#a8ac34c174b84a90b17260847ddf749d7">Config::msb</a></div><div class="ttdeci">uint8_t msb</div><div class="ttdoc">Byte MSB. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:29</div></div>
<div class="ttc" id="class_a_d_s1118_html_a8d79b157a07574bd8745137a8347649e"><div class="ttname"><a href="class_a_d_s1118.html#a8d79b157a07574bd8745137a8347649e">ADS1118::decodeConfigRegister</a></div><div class="ttdeci">void decodeConfigRegister(union Config configRegister)</div><div class="ttdoc">Decoding a configRegister structure and then print it out to the Serial port. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:241</div></div>
<div class="ttc" id="class_a_d_s1118_html_af739fb00547d7a5df8c5010c40b64c6a"><div class="ttname"><a href="class_a_d_s1118.html#af739fb00547d7a5df8c5010c40b64c6a">ADS1118::setContinuousMode</a></div><div class="ttdeci">void setContinuousMode()</div><div class="ttdoc">Setting to continuous adquisition mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:212</div></div>
<div class="ttc" id="union_config_html_a384bc94c34f34120311b0fddb47fd310"><div class="ttname"><a href="union_config.html#a384bc94c34f34120311b0fddb47fd310">Config::pullUp</a></div><div class="ttdeci">uint8_t pullUp</div><div class="ttdoc">&quot;PULL_UP_EN&quot; bit </div><div class="ttdef"><b>Definition:</b> ADS1118.h:18</div></div>
<div class="ttc" id="class_a_d_s1118_html_a683b66748ece91703c8ccc1920a6f762"><div class="ttname"><a href="class_a_d_s1118.html#a683b66748ece91703c8ccc1920a6f762">ADS1118::DIFF_1_3</a></div><div class="ttdeci">const uint8_t DIFF_1_3</div><div class="ttdoc">Differential input: Vin=A1-A3. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:58</div></div>
<div class="ttc" id="class_a_d_s1118_html_ab41e0ba159527f2fc8d48cbedc653380"><div class="ttname"><a href="class_a_d_s1118.html#ab41e0ba159527f2fc8d48cbedc653380">ADS1118::configRegister</a></div><div class="ttdeci">union Config configRegister</div><div class="ttdoc">Config register. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:65</div></div>
<div class="ttc" id="class_a_d_s1118_html_addf0469ded07f0cf2c7566745a9bf197"><div class="ttname"><a href="class_a_d_s1118.html#addf0469ded07f0cf2c7566745a9bf197">ADS1118::RESERVED</a></div><div class="ttdeci">const uint8_t RESERVED</div><div class="ttdoc">Its value is always 1, reserved. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:90</div></div>
<div class="ttc" id="class_a_d_s1118_html_a8e9e4f86cb2487a24b539c2f7424324d"><div class="ttname"><a href="class_a_d_s1118.html#a8e9e4f86cb2487a24b539c2f7424324d">ADS1118::DIFF_2_3</a></div><div class="ttdeci">const uint8_t DIFF_2_3</div><div class="ttdoc">Differential input: Vin=A2-A3. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:59</div></div>
<div class="ttc" id="union_config_html_a75dfa0206a4d86658d165163040905d7"><div class="ttname"><a href="union_config.html#a75dfa0206a4d86658d165163040905d7">Config::singleStart</a></div><div class="ttdeci">uint8_t singleStart</div><div class="ttdoc">&quot;SS&quot; bit </div><div class="ttdef"><b>Definition:</b> ADS1118.h:24</div></div>
<div class="ttc" id="class_a_d_s1118_html_af146984531345834e8caaf0ffe017735"><div class="ttname"><a href="class_a_d_s1118.html#af146984531345834e8caaf0ffe017735">ADS1118::START_NOW</a></div><div class="ttdeci">const uint8_t START_NOW</div><div class="ttdoc">Start of conversion in single-shot mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:71</div></div>
<div class="ttc" id="class_a_d_s1118_html_acf67a3c09b9d165f04e2e37e618e4fcb"><div class="ttname"><a href="class_a_d_s1118.html#acf67a3c09b9d165f04e2e37e618e4fcb">ADS1118::getTemperature</a></div><div class="ttdeci">double getTemperature()</div><div class="ttdoc">Getting the temperature in degrees celsius from the internal sensor of the ADS1118. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:158</div></div>
<div class="ttc" id="class_a_d_s1118_html_af9f2d072f99bdce404c613135ba07829"><div class="ttname"><a href="class_a_d_s1118.html#af9f2d072f99bdce404c613135ba07829">ADS1118::RATE_32SPS</a></div><div class="ttdeci">const uint8_t RATE_32SPS</div><div class="ttdoc">32 samples/s, Tconv=31.25ms </div><div class="ttdef"><b>Definition:</b> ADS1118.h:105</div></div>
<div class="ttc" id="class_a_d_s1118_html_adf872650d20977b5872f88fa36182d3a"><div class="ttname"><a href="class_a_d_s1118.html#adf872650d20977b5872f88fa36182d3a">ADS1118::getADCValue</a></div><div class="ttdeci">uint16_t getADCValue(uint8_t inputs)</div><div class="ttdoc">Getting a sample from the specified input. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:91</div></div>
<div class="ttc" id="class_a_d_s1118_html_afaddf1d46e3b32d433c67122d96a6ebb"><div class="ttname"><a href="class_a_d_s1118.html#afaddf1d46e3b32d433c67122d96a6ebb">ADS1118::ADS1118</a></div><div class="ttdeci">ADS1118(uint8_t io_pin_cs)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> ADS1118.cpp:70</div></div>
<div class="ttc" id="class_a_d_s1118_html_ac79cd7f4808c3b4ff2721e2e8b6140ba"><div class="ttname"><a href="class_a_d_s1118.html#ac79cd7f4808c3b4ff2721e2e8b6140ba">ADS1118::CONTINUOUS</a></div><div class="ttdeci">const uint8_t CONTINUOUS</div><div class="ttdoc">Continuous conversion mode. </div><div class="ttdef"><b>Definition:</b> ADS1118.h:78</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
